<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class TravideTestFunctional extends sfTestFunctional {

    /**
     * Fetches the most recently updated CollectionItem
     * -- used when tests add to the database or need to find a collection
     */
    public function getLastestCollection(){
        $q = Doctrine::getTable('CollectionItem')->createQuery();
        $q->addOrderBy('updated_at desc');
        return $q->fetchOne();
    }

    public function getLatestCollectionType() {
        $q = Doctrine::getTable('CollectionType')->createQuery();
        return $q->fetchOne();
    }


    public function loadData() {
        Doctrine::loadData(sfConfig::get('sf_data_dir').'/fixtures');

        return $this;
    }

    public function setDoctrineTester(){
        $this->setTester('doctrine', 'sfTesterDoctrine');

    }

    public function setUp(){
        $this->loadData();
        $this->setDoctrineTester();
    }
}

?>
